package com.v1.video.option.db;

import org.json.JSONObject;

import android.content.ContentValues;
import android.database.Cursor;

import com.iss.bean.BaseBean;
import com.iss.db.TableColumn;
import com.v1.video.domain.MessageFocusInfo;

public class SetMessageCommentInfo extends BaseBean<SetMessageCommentInfo> {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    @TableColumn(type = TableColumn.Types.TEXT)
    public String videoId;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String commentsId = "";
    @TableColumn(type = TableColumn.Types.TEXT)
    public String comments;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String createTime;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String userId;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String userName;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String userImg;     //相对路径，使用时需要增加全局的网址
    @TableColumn(type = TableColumn.Types.TEXT)
    public String replyUserId;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String replyUserName;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String praiseCont;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String video_url;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String title;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String img_url;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String detail;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String focusUserId;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String focusUserName;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String focusUserImg;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String details;
    @TableColumn(type = TableColumn.Types.INTEGER)
    public int state;
    @TableColumn(type = TableColumn.Types.TEXT)
    public String href = ""; //新闻的视频详情页的链接
    @TableColumn(type = TableColumn.Types.TEXT)
    public String stype = ""; //0表示新闻的视频1表示拍客的视频
    @TableColumn(type = TableColumn.Types.TEXT)
    public String sex = ""; //0表示新闻的视频1表示拍客的视频
    @TableColumn(type = TableColumn.Types.TEXT)
    public String focusUserSex = ""; //0表示新闻的视频1表示拍客的视频
    @TableColumn(type = TableColumn.Types.INTEGER)
    public int type = 0;//0表示评论1表示关注本字段，服务器不下发，本地根据数据判断赋值；
    
    public SetMessageCommentInfo(){
        
    }
    
    public SetMessageCommentInfo(MessageFocusInfo info){
        this.videoId = info.getVideoId();
        this.commentsId = info.getCommentsId();
        this.comments = info.getComments();
        this.createTime = info.getCreateTime();
        this.userId = info.getUserId();
        this.userName = info.getUserName();
        this.userImg = info.getUserImg();
        this.replyUserId = info.getReplyUserId();
        this.replyUserName = info.getReplyUserName();
        this.praiseCont = info.getPraiseCont();
        this.video_url = info.getVideo_url();
        this.title = info.getTitle();
        this.img_url = info.getImg_url();
        this.focusUserId = info.getFocusUserId();
        this.focusUserName = info.getFocusUserName();
        this.focusUserImg = info.getFocusUserImg();
        this.details = info.getDetails();
        this.detail = info.getDetail();
        this.href = info.getHref();
        this.stype = info.getStype();
        this.sex = info.getSex();
        this.focusUserSex = info.getFocusUserSex();
        this.type = info.getType();        
    }
        
    @Override
    public SetMessageCommentInfo parseJSON(JSONObject jsonObj) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public JSONObject toJSON() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public SetMessageCommentInfo cursorToBean(Cursor cursor) {
        // TODO Auto-generated method stub
        videoId = cursor.getString(cursor.getColumnIndex("videoId"));
        commentsId = cursor.getString(cursor.getColumnIndex("commentsId"));
        comments = cursor.getString(cursor.getColumnIndex("comments"));
        createTime = cursor.getString(cursor.getColumnIndex("createTime"));
        userId = cursor.getString(cursor.getColumnIndex("userId"));
        userName = cursor.getString(cursor.getColumnIndex("userName"));
        userImg = cursor.getString(cursor.getColumnIndex("userImg"));
        replyUserId = cursor.getString(cursor.getColumnIndex("replyUserId"));
        replyUserName = cursor.getString(cursor.getColumnIndex("replyUserName"));
        praiseCont = cursor.getString(cursor.getColumnIndex("praiseCont"));
        video_url = cursor.getString(cursor.getColumnIndex("video_url"));
        title = cursor.getString(cursor.getColumnIndex("title"));
        img_url = cursor.getString(cursor.getColumnIndex("img_url"));
        detail = cursor.getString(cursor.getColumnIndex("detail"));
        focusUserId = cursor.getString(cursor.getColumnIndex("focusUserId"));
        focusUserName = cursor.getString(cursor.getColumnIndex("focusUserName"));
        focusUserImg = cursor.getString(cursor.getColumnIndex("focusUserImg"));
        details = cursor.getString(cursor.getColumnIndex("details"));
        state =  cursor.getInt(cursor.getColumnIndex("state"));
        href =  cursor.getString(cursor.getColumnIndex("href"));
        stype =  cursor.getString(cursor.getColumnIndex("stype"));
        sex =  cursor.getString(cursor.getColumnIndex("sex"));
        focusUserSex =  cursor.getString(cursor.getColumnIndex("focusUserSex"));
        type =  cursor.getInt(cursor.getColumnIndex("type"));
        return this;
    }

    @Override
    public ContentValues beanToValues() {
        // TODO Auto-generated method stub
        ContentValues values = new ContentValues();
        values.put("videoId", videoId);
        values.put("commentsId", commentsId);
        values.put("comments", comments);
        values.put("createTime", createTime);
        values.put("userId", userId);
        values.put("userName", userName);
        values.put("userImg", userImg);
        values.put("replyUserId", replyUserId);
        values.put("replyUserName", replyUserName);
        values.put("praiseCont", praiseCont);
        values.put("video_url", video_url);
        values.put("title", title);
        values.put("img_url", img_url);
        values.put("detail", detail);
        values.put("focusUserId", focusUserId);
        values.put("focusUserName", focusUserName);
        values.put("focusUserImg", focusUserImg);
        values.put("details", details);
        values.put("state", state);
        values.put("href", href);
        values.put("stype", stype);
        values.put("sex", sex);
        values.put("focusUserSex", focusUserSex);
        values.put("type", type);
        return values;
    }    
}
